using Admin.NET.Core;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （物料安全库存配置）
/// </summary>
public class PartsSafeStockOutput : PartsSafeStock
{
    /// <summary>
    /// 部门或车间 （字典名称）
    /// </summary>
    public string? WorkshopName { get; set; }

    public string PartNo { get; set; } //唯一索引

    public Guid Workshop { get; set; } //唯一索引

    /// <summary>
    /// 关联对象等
    /// </summary>
    //public string? WePartyLevelName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class PartsSafeStockInput
{
    /// <summary>
    /// </summary>
    public long? Id { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    public string? PartNo { get; set; }  //唯一索引

    /// <summary>
    /// 部门或车间
    /// </summary>
    public Guid? Workshop { get; set; }  //唯一索引
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetPartsSafeStockInput : BaseOrderInput
{
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PagePartsSafeStockInput : BasePageInput
{
    /// <summary>
    /// 物料编号
    /// </summary>
    public string? PartNo { get; set; }  //唯一索引

    /// <summary>
    /// 部门或车间
    /// </summary>
    public Guid? Workshop { get; set; }  //唯一索引
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddPartsSafeStockInput
{
    /// <summary>
    /// 物料编号
    /// </summary>
    [Required, MaxLength(50)]
    public string PartNo { get; set; } = string.Empty;

    /// <summary>
    /// 部门或车间
    /// </summary>
    public Guid Workshop { get; set; }

    /// <summary>
    /// 最低库存
    /// </summary>
    public decimal LowNum { get; set; }

    /// <summary>
    /// 最高库存
    /// </summary>
    public decimal MaxNum { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdatePartsSafeStockInput
{
    /// <summary>
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    [MaxLength(50)]
    public string PartNo { get; set; }

    /// <summary>
    /// 部门或车间
    /// </summary>
    public Guid Workshop { get; set; }

    /// <summary>
    /// 最低库存
    /// </summary>
    public decimal LowNum { get; set; }

    /// <summary>
    /// 最高库存
    /// </summary>
    public decimal MaxNum { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [MaxLength(20)]
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

/// <summary>
/// 删除参数
/// </summary>
public class DeletePartsSafeStockInput
{
    /// <summary>
    /// </summary>
    public long Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomePartsSafeStockInput
{
    /// <summary>
    /// </summary>
    public long Id { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    public string? PartNo { get; set; }  //唯一索引

    /// <summary>
    /// 部门或车间
    /// </summary>
    public string? Workshop { get; set; }  //唯一索引
}